home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / x25 / nrs.shar.Z / nrs.shar / nrs.ms < prev    next >
Encoding:
Text File  |  1990-04-27  |  19.2 KB  |  670 lines

  1. .\"  RCSid[] = "@(#)$Header: nrs.ms,v 3.4 88/05/27 06:25:28 pb Rel $"
  2. .TL
  3. A Quick Jog Through Configuring The Nrs Processor.
  4. .AU
  5. Julian Onions
  6. .AI
  7. Computer Science Group,
  8. Nottingham University.
  9. .AU
  10. Piete Brooks
  11. .AI
  12. University of Cambridge Computer Laboratory,
  13. New Museum Site, Pembroke Street, CB2 3QG
  14. .AU
  15. Adrian Pell
  16. .AI
  17. Department of Computer Science,
  18. University of Reading.
  19. .NH
  20. Introduction
  21. .LP
  22. This document describes how to build yourself a configuration
  23. file for the nrs database cruncher, hereinafter referred to as the
  24. .I nrs
  25. program.
  26. .LP
  27. Currently the
  28. .I nrs
  29. program runs under
  30. .UX
  31. (BSD 4.2/ULTRIX 1.2 on VAX 11/750s, VAX 11/780s, Microvax IIs,
  32. Orions and Suns;
  33. V7/ULTRIX 11 on PDP/11s;
  34. System V on GEC 63s), VMS (VAX VMS C 2.1 on Microvax IIs) and
  35. PRIMOS, and can be run in one of six modes, as detailed in section 3.2,
  36. .IP 1)
  37. York X25 directory mode (R2.2 or R2.1)
  38. .IP 2)
  39. MMDF table generation mode.
  40. .IP 3)
  41. X25hosts directory mode (UBC code).
  42. .IP 4)
  43. Text mode (as per t.central, PR1ME and Edinburgh).
  44. .IP 5)
  45. VMS mode.
  46. .IP 6)
  47. Sendmail mode (UK or Reading versions).
  48. .IP 7)
  49. DBM mode (for unix-niftp)
  50. .NH
  51. The NRS Database Format
  52. .LP
  53. This is a brief introduction to the structure of the
  54. NRS Database. For more details, read the NRS
  55. document
  56. .ul
  57. Making and Using Derived Databases
  58. by Dr. R.D. Baker, obtainable from the University of Salford.
  59. .LP
  60. The NRS Database consists of one file which is made up of the following
  61. sections (previously separate files - these are still accepted):
  62. .LP
  63. A section known as
  64. .I MODULE2 ,
  65. which contains within it
  66. all the long and short NRS registered hosts together with
  67. associated pointers to the
  68. .I MODULE4
  69. section.
  70. .LP
  71. A section known as
  72. .I MODULE3 ,
  73. which contains information used for reverse lookups and is used
  74. if reverse lookups are indicated.
  75. .LP
  76. A section known as
  77. .I MODULE4 ,
  78. which contains information groups of records called quads
  79. which give the filename and offset in one of the
  80. .I ATOMIC
  81. sections.
  82. .LP
  83. A number of
  84. .I ATOMIC
  85. sections, one for each network-context pair.
  86. These
  87. .I ATOMIC
  88. files contain the
  89. .I DTE
  90. address of the host,
  91. the Yellow Book Transport Service address if any,
  92. a list of application relays if any
  93. and the description text (in the DESC context only).
  94. Therefore to look up a host involves three file accesses.
  95. .LP
  96. The purpose of the
  97. .I nrs
  98. program, is to run through this data in one go, and print
  99. it out in formats expected by other programs.
  100. .br
  101. NB:
  102. The
  103. .I nrs
  104. program can be compiled so that only one or two output formats
  105. are selected. This is to cut down on space and memory requirements.
  106. If this is the case, some output specific keywords may not be
  107. recognised.
  108. .NH
  109. The configuration file
  110. .LP
  111. .DS
  112. nrs [<config-file>] [<options>]*
  113. .DE
  114. The normal use is to supply 
  115. .I nrs 
  116. with a configuration file,
  117. however other options may be added in the same format as
  118. the configuration file options to overide or alter the options
  119. in the configuration file.
  120. This behaviour is similar to the way 
  121. .I awk (1)
  122. treats its arguments.
  123. .LP
  124. Within the configuration file, of which there should be some
  125. examples with the program, there are several lines giving
  126. control information to the nrs program.
  127. Each line is read in turn and parsed into arguments.
  128. Comment lines start with a hash `#' character and are
  129. completely ignored, as are blank lines.
  130. All other lines are examined for control information.
  131. The control line keywords are generally case insensitive,
  132. but where they specify values such as filenames, the filenames
  133. must be in the right case.
  134. Arguments are separated by white space.
  135. .LP
  136. .NH 2
  137. General Control Lines
  138. .LP
  139. The following control lines have general use regardless
  140. of which mode the program is to run in.
  141. .DS
  142. directory <directory-name>
  143. .DE
  144. This gives a directory name to prepend to all input file names,
  145. thus enabling the data to be separated from the results.
  146. On
  147. .UX
  148. a / is inserted between the directory and the filename,
  149. and the directory parameter if present can be overridden for a
  150. particular file by either giving the full pathname, or a
  151. relative pathname (one starting ./ or ../).
  152. On
  153. VMS
  154. the filename is directly suffixed to the directory name, but the directory is
  155. ignored if the pathname contains a colon (:), a dollar ($) or an open square
  156. bracket ([).
  157. On PR1MEs a ket (>) is inserted between the directory and the filename,
  158. unless the file name contains a ket (>), in which case it is used directly.
  159. .DS
  160. derfil  <filename>
  161. .DE
  162. This control line sets up the name of the NRS derived file for the
  163. .I nrs
  164. program. If this line are missing, the filename will default to
  165. DERFIL2
  166. .DS
  167. domains  [<filename>]
  168. .DE
  169. This control line instructs the processor to include the domain gateway
  170. information if the format supports it.
  171. The filename is needed only if it is processing filettes.
  172. A destination file for the output should be given, i.e.
  173. .DS
  174. filedmn top.dmn -top.dmn-
  175. .DE
  176. where the special name -top.dmn- is used for mmdf and -top.dom- for sendmail.
  177. .DS
  178. filedmn <file-name> [<short-dmn-name> [<long-dmn-name> [local]]]
  179. .DE
  180. These are used by mmdf and sendmail formats to specify where domain table
  181. information is to be written for specified sub-domains.
  182. If no long domain name is given it is assumed to be identical to the short
  183. domain name.
  184. If no short domain name is given,
  185. then the short domain is set to a state where it matches all domains,
  186. so this acts as a catch all.
  187. As these tables are scanned in the order,
  188. the order in which they appear is critical.
  189. To show how these fields work, an example of how the nottingham
  190. setup is configured.
  191. .DS
  192. .ta \w'filedmn uk-ac-nott-dmn  'u +\w'uk.ac.nott.  'u
  193. filedmn uk-ac-nott-dmn  uk.ac.nott. uk.ac.nottingham.
  194. filedmn uk-ac-dmn    uk.ac.
  195. filedmn uk-co-dmn    uk.co.
  196. filedmn cern-dmn    cern.
  197. filedmn desy-dmn    desy.
  198. filedmn top-dmn    -top.dmn-
  199. filedmn misc-dmn
  200. .DE
  201. .TA
  202. This specifies that having got an address, it is run down the
  203. list of preferred domains (as set by
  204. .I short/long
  205. )
  206. to see if any are a prefix. The last
  207. line catches anything unmatched.
  208. So with a host such as
  209. .DS
  210. .ta \w'uk.ac.nott.cs 'u
  211. short        long
  212. uk.ac.nott.cs    uk.ac.nottingham.computer-science
  213. .DE
  214. There is a match in the first line as uk.ac.nott. is a prefix.
  215. This is then marked as a hit and the long and short domains
  216. stripped off to give
  217. .DS
  218. .ta \w'uk.ac.nott.cs 'u
  219. short    long
  220. cs    computer-science
  221. .DE
  222. These are then put into the uk-ac-nott-dmn file as
  223. .DS
  224. cs:computer-science.nottingham.ac.uk
  225. computer-science:computer-science.nottingham.ac.uk
  226. .DE
  227. With a host such as uk.ac.ucl.cs, the first hit is in the uk.ac. entry so the
  228. result is put into the uk-ac-dmn file.
  229. If the host has application relays, these are listed after
  230. the entry as relays.
  231. If the local flags is given, any application relays are supressed.
  232. .PP
  233. Mmdf and sendmail have special domains, -top.dmn- and -top.dom- respectively,
  234. to which the NRS gateway information is sent, e.g. the fact that mail to MIL.
  235. goes via uk.ac.ucl.cs.
  236. Sendmail also has the special domain -abbrev.dom- which is where the aliases
  237. between long and short forms are put.
  238. .DS
  239. filechan <filename> <network> [<prefix>]
  240. .DE
  241. Channel tables may also be built whilst constructing the domain tables.
  242. After putting the name into a domain table, the host is looked up in the list
  243. of networks attached to the filechan control.
  244. If a match is found, it is put into the associated filename.
  245. A typical setup is
  246. .DS
  247. filechan pss-chan    pss
  248. filechan janet-chan    janet
  249. .DE
  250. The optional third argument, used only for MMDF, will cause that prefix to be
  251. stripped off on the RHS of the channel table.
  252. E.g.
  253. .DS
  254. filechan janet-chan janet uk.ac.
  255. .DE
  256. will result in entries of the form
  257. .DS
  258. name.host.ac.uk:host.name
  259. .DE
  260. which may help match up with entries in your x25 directory.
  261. For sendmail UK-1.4, channel table entries are only constructed for mail sites
  262. which need applicatiom relays.
  263. .LP
  264. .DS
  265. gateway [pss|janet] <gatewayhost>
  266. .DE
  267. This is used by both york formats and smail format to specify a gateway host
  268. to a particular network.
  269. .DS
  270. relay_host <hostname>
  271. .DE
  272. If this is present for MMDF format, then entries are matched in the list of
  273. domains as before, but have added after their entry the hostname
  274. specified in the relay_host line.
  275. This is so that if the host you are building the table for is not actually
  276. connected to the network directly, all hosts may be relayed
  277. through another host first to reach the network.
  278. E.g.
  279. .DS
  280. relay_host hcig.nott.ac.uk
  281. .DE
  282. would alter the above case of ucl.cs to
  283. .DS
  284. cs.ucl:cs.ucl.ac.uk hcig.nott.ac.uk
  285. .DE
  286. Any application relays in this case are thrown away. It is
  287. presumed that the relay host will know the best route from then on.
  288. Sendmail UK-1.4 used a uk entry in top.dom to do off-janet sites.
  289. .LP
  290. However to stop spurious entries such as
  291. .DS
  292. ourname:ourname.ourdomain.ac.uk relayhost
  293. .DE
  294. which is an infinite loop, the local keyword is attached to a
  295. domain which suppresses the relayhost for those entries.
  296. .DS
  297. verbose [<number>]
  298. .DE
  299. This parameter sets the level of information messages produced to number
  300. (or one if missing).
  301. If no
  302. .I verbose
  303. control line is present,
  304. or the verbose setting is 0,
  305. only fatal errors and warning messages
  306. will be given.
  307. .DS
  308. context <context> <network>
  309. .DE
  310. This control line specifies to the
  311. .I nrs
  312. program that the
  313. .I ATOMIC
  314. section for the given context and the given
  315. network should be used.
  316. The context parameter may be any of the following keywords.
  317. .IP X29 14
  318. Remote login to an interactive service using X29.
  319. .IP TS29 14
  320. Remote login to an interactive service using TS29.
  321. .IP NIFTP 14
  322. File access to some filestore using NIFTP protocol.
  323. .IP FTP 14
  324. A synonym for above
  325. .IP MAIL-NIFTP 14
  326. Electronic mail to an individual in some organisation,
  327. using Grey Book Mail protocol over NIFTP.
  328. .IP MAIL 14
  329. A synonym for above.
  330. .IP MAIL-X29 14
  331. Electronic mail over X29 connections.
  332. .\" bluff bluff bluff - I'm not sure what this is really.
  333. .IP MAIL-TELEX 14
  334. Electronic mail to Telex Machines
  335. .\" I hope!
  336. .IP JTMP 14
  337. Job Transfer and Manipulation Protocol for running jobs
  338. and printing output.
  339. .IP JTMP-FILES 14
  340. File store references with in JTMP descriptors (whatever that means!).
  341. .IP JTMP-REG 14
  342. Registration authorities referenced within JTMP descriptors (ditto).
  343. .IP YBTS-NODE 14
  344. Yellow Book Transport Service locations (???)
  345. .IP YBTS 14
  346. Yellow Book Transport service interprocess connections (???)
  347. .IP DESC 14
  348. The Description Text for the host.
  349. .IP 
  350. .LP
  351. A complete set of contexts
  352. and networks should be found in the york configuration
  353. file supplied as an example.
  354. .LP
  355. The network keyword is currently one of
  356. .IP JANET 14
  357. The Joint Academic network.
  358. .IP PSS 14
  359. The British Telecom Packet Switched network.
  360. .IP TELEX 14
  361. The Telex network.
  362. .LP
  363. Often, for a particular type of output, you are only interested
  364. in certain combinations of contexts and networks, for instance
  365. mmdf is only interested in mail addresses, so most of the contexts
  366. are redundant and shouldn't be included.
  367. .DS
  368. file <filename> <context> <network>
  369. module2 <filename>
  370. module3 <filename>
  371. module4 <filename>
  372. .DE
  373. These are used for the old filettes format (do not use these - use DERFIL2).
  374. They map a section onto a filename.
  375. .NH 2
  376. Output specific control lines.
  377. .LP
  378. The output format is specified by the output keyword which takes optional
  379. flags indicating a preference for long or short names, the desired mapping as
  380. forward or reverse and the desired case of the output.
  381. After this may come the mode and any mode specific options.
  382. .DS
  383. output [long|short] [forward|reverse] [mixed|lower] [<mode> [<option>]*]
  384. .DE
  385. Several of the modes have a `preferred' mapping (i.e. long or short);
  386. in mmdf mode it determines which form appears first in the tables,
  387. the form of the RHS of the domain table and the form of the channel table;
  388. in sendmail mode it specifies which is the main name, and which is the alias.
  389. If there are no explicit instructions for the requied format,
  390. do not quote either form.
  391. .LP
  392. Normally the sequence is to scan through the MODULE2 section,
  393. reading each record in turn and looking up the values in the
  394. other sections.
  395. This behaviour gives the forward lookup type tables.
  396. If reverse is set, then the MODULE3 section is read in a record at a time and the
  397. various records from other sections are collected.
  398. This sort of processing gives reverse lookup type tables,
  399. and is currently only generally useful with york and text format output.
  400. .LP
  401. The case of the produced output can be selected by use of the
  402. .I mixed/lower
  403. flags which leave the case as it is (usually UPPER CASE), or force it to lower
  404. case.
  405. .NH 3
  406. York Format Output
  407. .LP
  408. .DS
  409. output york
  410. output york2.1 [<prefix>]
  411. .DE
  412. The optional second parameter represents a prefix string to strip off all
  413. names and is applicable only to the older format (R2.1) directory format.
  414. This format should not be used as it is highly deficient.
  415. .DS
  416. output york2.1 uk.ac.
  417. .DE
  418. makes uk.ac.cam.cl appear as cam.cl.
  419. With D2.2 the directory contains the full names, and the stripping is done
  420. much more cleverly by the programme which created the DBM file.
  421. .IP \fIforward/reverse\fR 16
  422. indicate the direction of the mapping.
  423. .LP
  424. .DS
  425. gateway <network> <string>
  426. .DE
  427. Gateway is used if you have to go through a gateway to get to a network.
  428. The network argument may be pss or janet.
  429. The string is prefixed to any DTE on the specified network.
  430. E.g.
  431. .DS
  432. Gateway PSS 000000002105/
  433. .DE
  434. produces lines of the form
  435. .DS
  436. 0:PSS:X:psshost:000000002105/000012345678:
  437. .DE
  438. .NH 3
  439. MMDF format output
  440. .LP
  441. This is rather more complicated than the york format, but
  442. with an example config file it shouldn't be too hard ...
  443. .IP \fIshort/long\fR 16
  444. indicates whether to generate an mmdf domain table
  445. mapping short to long addresses, or long to short address.
  446. .LP
  447. The output in mmdf format is set up by the control line
  448. .DS
  449. output mmdf
  450. .DE
  451. The hard part comes in working out what domains your interested
  452. in and what to do with them - see filedmn for domain tables
  453. and filechan for channel tables.
  454. .NH 3
  455. x25hosts format output
  456. .LP
  457. This format is useful if you are in need of an /etc/hosts
  458. type of format. It only lists entries without application relays or yellow
  459. book transport service strings. This is currently only used by the UBC X25
  460. software but may be used by other 4.2 networking code in the future.
  461. .LP
  462. It is enabled by the line
  463. .DS
  464. output x25hosts [<prefix>]
  465. .DE
  466. The optional second argument is assumed to be a prefix to strip off the
  467. entries.
  468. The output format is
  469. .DS
  470. dteaddr [stripped-form] short-form long-form
  471. .DE
  472. Addresses with application relays are discarded.
  473. .NH 3
  474. Text format output
  475. .LP
  476. .IP \fIforward/reverse\fR 16
  477. should be set as appropriate.
  478. .IP \fIshort/long\fR 16
  479. selects the format in which the name is to be printed.
  480. The default is to print both.
  481. .LP
  482. .DS
  483. output text
  484. .DE
  485. .LP
  486. The output is in `human readable' format.
  487. This is in a similar style to the NRS `t.central' format.
  488. .NH 3
  489. VMS format output
  490. .LP
  491. .DS
  492. output [ignorerelay] vms
  493. .DE
  494. .LP
  495. The output is in a format for feeding into NETAUTH, one of the programmes in
  496. the "Coloured Books" package written by UWIST and St Andrews and marketed by
  497. DEC which runs over PSI.
  498. The standard header actually generates a DCL command file.
  499. This produces optimised commands to process all names of less than 33
  500. characters (a limitation applied by NETAUTH) of the form
  501. .DS
  502. D nrsname
  503. A nrsname+=commonDTEprefix+context1=suffix1+context2=suffix2
  504. .DE
  505. It puts quotes wherever there are any suspect characters,
  506. arranges for the context with a null suffix to appear at the end,
  507. handles different DTEs for the same name, etc. etc..
  508. .br
  509. However, the algorithms were worked out by guess work so may need fixing.
  510. .br
  511. NETAUTH cannot make any use of application relays, so if the programme is
  512. being used as an NRS table generator, then these entries are omitted.
  513. However, if it is being used as a GreyBook table generator, it is permissable
  514. to omit the application relays, so the flag
  515. .B ignorerelay
  516. can be given, and the entries will be generated with the application relays
  517. doscarded.
  518. .NH 3
  519. Sendmail and Smail format output
  520. .LP
  521. .IP \fIshort/long\fR 16
  522. should be set as appropriate for sendmail (ignored by smail).
  523. .LP
  524. .DS
  525. output sendmail
  526. output smail
  527. .DE
  528. .LP
  529. The output is for processing by Jim Crammond's UK Sendmail package,
  530. or Reading's smail.
  531. The sendmail info is based upon mmdf's domain and channel tables
  532. (see mmdf mode)
  533. .NH 3
  534. DBM (unix-niftp) format output
  535. .LP
  536. .IP \fIforward/reverse\fR 16
  537. should be set as appropriate.
  538. .IP \fIshort/long\fR 16
  539. indicates whether the long or short form is the primary key.
  540. .LP
  541. .DS
  542. output dbm
  543. .DE
  544. .LP
  545. The output is in a format for feeding into dbmencode after optional editing of
  546. fields not supplied by the NRS.
  547. .NH 3
  548. PR1ME text format output
  549. .LP
  550. .IP \fIforward/reverse\fR 16
  551. should be set as appropriate.
  552. .LP
  553. .DS
  554. output prime
  555. .DE
  556. .LP
  557. The output is in a format used on PR1ME systems, and is very similar to
  558. t.central.
  559. .NH 3
  560. Edinburgh text format output
  561. .LP
  562. .DS
  563. output edtext [simple|short|long]
  564. .DE
  565. .LP
  566. The output is in a text format devised in Edinburgh, much preferable to
  567. t.central.
  568. If short and/or long is specified every line is to be prefixed with the
  569. relevant name, e.g. to allow a simple search to return the useful information.
  570. If no flag is given, short is used (simple implies no names).
  571. .LP
  572. This format is intended to dump the ENTIRE database, so ALL contexts should be
  573. requested.
  574. If this is not done, a warning is generated when the first missing context is
  575. processed.
  576. .NH
  577. Supplemental commands
  578. .LP
  579. .DS
  580. comment <filename>
  581. .DE
  582. will cause the contents of the file given to be filtered through a small macro
  583. expander which replaces certain keys with values rather like RCS keywords,
  584. when writing to an output for the first time.
  585. This helps keep files in sync across several machines.
  586. At present the following keys are expanded:
  587. .IP $C$
  588. This expands to some text relevant to the output type.
  589. .IP $D$
  590. The current date and time in ctime(3) format.
  591. .IP $F$
  592. The current file name.
  593. .IP $H$
  594. The hostname of this host. This may be set with the
  595. control
  596. .I "hostname string"
  597. (see below).
  598. .IP $N$
  599. The Version of the NRS database used in building this file.
  600. This information is gleaned from the database headers.
  601. .LP
  602. .DS
  603. hostname <name>
  604. .DE
  605. specifies the hostname for the comment field $H$.
  606. This overrides the name returned by the gethostname (BSD) or
  607. uname (USG) call.
  608. .NH
  609. Error messages.
  610. .LP
  611. Most error messages are hopefully self explanatory,
  612. but a few could bear further explanation.
  613. .DS
  614. lru botch - can't reclaim an lru file descriptor.
  615. problem on getm2rec rec %d - bad format MODULE2 section
  616. Can't find corresponding short entry for %s
  617.     - again a bad format MODULE2 section
  618. problem on getm4rec rec %d - bad format MODULE4 section
  619. already got a dte - a host has more than one dte address
  620. already got a yb - a host has more than one ybts string
  621. unknown line, '%s' '%s' - bad format atomic file
  622. Files are out of sync - the atomic files + the modules files
  623.         are not all from the same run of the salford
  624.         database - reget the atomic + modules files.
  625. .DE
  626. .NH
  627. Problems
  628. .LP
  629. No doubt there will be problems ...
  630. if so you can contact any of us at:
  631. .DS
  632. Email Addresses:
  633.  
  634. jpo@uk.ac.nott.cs (jpo@uk.ac.nottingham.computer-science)
  635. jpo@uk.ac.nott.hcig (jpo@uk.ac.nottingham.psychology.hcig)
  636.  
  637. pb@uk.ac.cam.cl (pb@uk.ac.cambridge.computer-lab)
  638. cam-cl.uucp!pb (...mcvax!ukc!cam-cl!pb)
  639.  
  640. A.R.Pell@uk.ac.reading
  641. .DE
  642. Alternatively if you're really stuck try
  643. .DS
  644. Snail Mail:
  645.  
  646. Julian Onions
  647. Computer Science Group,
  648. Nottingham University
  649. University Park,
  650. Nottingham
  651. NG7 2RD
  652. (+44) 602 506101 x3595
  653.  
  654. Piete Brooks
  655. Computer Laboratory,
  656. New Museum Site,
  657. Pembroke Street,
  658. Cambridge
  659. CB2 3QG
  660. (+44) 223 334659 (DDI)
  661.  
  662. Adrian Pell
  663. Dept. of Computer Science
  664. University of Reading
  665. PO Box 220
  666. Reading
  667. RG6 2AX
  668. (+44) 734 875123 x 411
  669. .DE
  670.